<template>
  <div>
    <div class="hot-title border-topbottom"><span class="hot-title-info">热门推荐</span></div>
    <el-row>
      <el-col :xs="12" :sm="6" :md="4" :lg="3" :xl="6" v-for="item in list" :key="item.activityId">
        <el-card :body-style="{ padding: '5px'}" class="el-card">
          <img :src="item.activityImg" class="image" />
          <div class="div-content">
            <span>{{item.activityName}}</span>
            <div class="bottom clearfix">
              <time class="time">{{item.currentDate}}</time> 
              <time class="num">{{item.tookNumber + '/' + item.limitNumber}}</time>
              <div style="display: flex;flex-direction: row-reverse;">
                <el-button type="text" class="button " size="medium" @click="todetail(item.activityId)">查看详情</el-button>
              </div>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'HomeComponents',
  props: {
    list: Array
  },
  data() {
    return {
      activeName: 'first'
    }
  },
  methods: {
    todetail(activityId) {
      this.$router.push('/detail/'+activityId)
    }
  }
}
</script>

<style scoped>
  .hot-title {
    line-height: 35px;
    padding: 2px 5px;
    vertical-align: middle;
    background-color: #eee;
    font-family: '微软雅黑';
    border-radius: 4px
  }
  .hot-title-info {
    vertical-align: middle;
    padding: 2px 5px
  }
  .time {
    font-size: 13px;
    color: #999;
  }
  .num {
  float: right;
  font-size: 13px;
  color: #999;
  width: 36.1px;
  text-align: center;
  }
  .bottom {
    margin-top: 13px;
    line-height: 12px;
  }
  .button {
  margin-top: 3px;
  }
  .image {
    width: 100%;
    display: block;
  }
  .clearfix:before,
  .clearfix:after {
      display: table;
      content: "";
  }
  .div-content {
    padding: 10px 14px 0 14px;
  }
  .el-card {
    height: 295px;
  }
</style>